import React, { useState } from "react";
import { Button, Input, Space } from "antd";

interface HeaderProps{
  addPlayUrl: (playUrl: string) => void;
}

const Header: React.FC<HeaderProps> = ({ addPlayUrl }) => {
  const [playUrl, setPlayUrl] = useState<string>();

  return <Space.Compact>
    <Input placeholder="请输入视频流地址" onChange={(e) => setPlayUrl(e.target.value)} />
    <Button onClick={() => {
      if(playUrl.trim()) addPlayUrl(playUrl.trim())
    }}>添加</Button>
  </Space.Compact>
}

export default Header;

